const logger = () => {
  return async (ctx, next) => {
    const start = Date.now();

    await next();

    const responseTime = Date.now() - start;
    console.log(`响应时间为: ${responseTime / 1000}s`);
  };
};

export default (app) => {
  app.use(logger());
};
